//
//  ColorTableViewCell.m
//  BeautyPicture
//
//  Created by LiuNa on 16/3/9.
//  Copyright © 2016年 szb. All rights reserved.
//

#import "ColorTableViewCell.h"

@implementation ColorTableViewCell

+ (instancetype)cellColorWithTableView:(UITableView *)tableView
{
    static NSString *ID = @"keyboardColor";
    ColorTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (cell == nil) {
        cell = [[ColorTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
        
    }
    return cell;
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.textLabel.textColor = [UIColor blackColor];
        self.textLabel.font = [UIFont systemFontOfSize:14.0f];
        self.backgroundColor = [UIColor clearColor];
        
        CGFloat imageY = 10.0f;
        CGFloat imageW = self.height - 20;
        CGFloat imageX = 23.0f;
        
        
        _a = [[UIButton alloc] initWithFrame:CGRectMake(imageX, imageY, imageW, imageW)];
        [self addSubview:_a];
    
        
        _b = [[UIButton alloc] initWithFrame:CGRectMake(imageX + 50, imageY, imageW, imageW)];
        [self addSubview:_b];
        
        _c = [[UIButton alloc] initWithFrame:CGRectMake(imageX + 50 * 2, imageY, imageW, imageW)];
        [self addSubview:_c];
        
        _d = [[UIButton alloc] initWithFrame:CGRectMake(imageX + 50 * 3, imageY, imageW, imageW)];
        [self addSubview:_d];
        
        _e = [[UIButton alloc] initWithFrame:CGRectMake(imageX + 50 * 4, imageY, imageW, imageW)];
        [self addSubview:_e];
        
        _f = [[UIButton alloc] initWithFrame:CGRectMake(imageX + 50 * 5, imageY, imageW, imageW)];
        [self addSubview:_f];
        
        
        
        CGFloat ImageX = 50.0f;
        
        _aa = [[UIButton alloc] initWithFrame:CGRectMake(ImageX, imageY, imageW, imageW)];
        [self addSubview:_aa];
        
        _bb = [[UIButton alloc] initWithFrame:CGRectMake(ImageX + 50, imageY, imageW, imageW)];
        [self addSubview:_bb];
        
        _cc = [[UIButton alloc] initWithFrame:CGRectMake(ImageX + 50 * 2, imageY, imageW, imageW)];
        [self addSubview:_cc];
        
        _dd = [[UIButton alloc] initWithFrame:CGRectMake(ImageX + 50 * 3, imageY, imageW, imageW)];
        [self addSubview:_dd];
        
        _ee = [[UIButton alloc] initWithFrame:CGRectMake(ImageX + 50 * 4, imageY, imageW, imageW)];
        [self addSubview:_ee];
        
    }
    return self;
}
- (void)setCellColorSubviewsNil
{
    
    self.indentationLevel = 0;
    [self.a setImage:nil forState:UIControlStateNormal];
    [self.b setImage:nil forState:UIControlStateNormal];
    [self.c setImage:nil forState:UIControlStateNormal];
    [self.d setImage:nil forState:UIControlStateNormal];
    [self.e setImage:nil forState:UIControlStateNormal];
    [self.f setImage:nil forState:UIControlStateNormal];
    [self.aa setImage:nil forState:UIControlStateNormal];
    [self.bb setImage:nil forState:UIControlStateNormal];
    [self.cc setImage:nil forState:UIControlStateNormal];
    [self.dd setImage:nil forState:UIControlStateNormal];
    [self.ee setImage:nil forState:UIControlStateNormal];
    self.textLabel.text = nil;
    self.textLabel.textColor = nil;
    self.textLabel.font = nil;
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
